<style scoped>
.el-tabs--card {
  height: calc(100vh - 140px);
}

.el-tab-pane {
  height: calc(100vh - 140px);
  overflow-y: auto;
}
</style>
<template>
  <div>
    <el-tabs v-model="activeName">
      <el-tab-pane label="场地列表" name="courtList">
        <court-list ref="courtList"/>
      </el-tab-pane>
      <el-tab-pane label="新增场地" name="courtAddNew">
        <court-add-new ref="courtAddNew" @changeTab="changeTab"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import courtList from "@/views/backState/site/court/courtList.vue";
import courtAddNew from "@/views/backState/site/court/courtAddNew.vue";

export default {
  name: "siteMain",
  components: {
    courtList,
    courtAddNew
  },
  data() {
    return {
      activeName: "courtList"
    }
  },
  methods: {
    changeTab(name) {
      this.activeName = name
      this.$refs.courtList.loadCourt();
      this.$refs.courtAddNew.resetForm();
    }
  }
}
</script>

